<?php self::tpl_display('header');?>
<script type="text/javascript">
function islock(obj,uid)
{
    $.get('<?php echo $url?>',{id:id},function(data){
        if(data != '1')
        {
            $(obj).html('<img src="<?php echo IMG_PATH?>error.png">');
        }
        else{
            $(obj).html('<img src="<?php echo IMG_PATH?>right.png">');
        }
        
    });
}
</script>
<div id="rightTop">
  <p><?php L('role_center')?></p>
  <ul class="subnav">
    <li><span><?php L('role')?></span></li>
    <li><a class="btn1" href="?m=admin&c=role&a=add"><?php L('add')?></a></li>
  </ul>
</div>

<div class="mrightTop">
  <div class="pageLinks">
      <?php self::tpl_display('page');?>
  </div>
</div>
<div class="tdare">
  <table width="100%" cellspacing="0" class="dataTable">
    <?php if($lists):?>
    <tr class="tatr1">
      <td width="20" class="firstCell"><input type="checkbox" class="checkall" /></td>
      <td><?php L('rolename')?></td>
      <td><span ectype="order_by" fieldname="reg_time"><?php L('description')?></span></td>
      <td style=" text-align: center;"><span ectype="order_by" fieldname="logins"><?php L('status')?></span></td>
      <td class="handler"><?php L('handler')?></td>
    </tr>
    <?php foreach($lists as $key => $v):?>
    <tr class="tatr2">
      <td class="firstCell"><?php if($v['id'] != 1):?><input type="checkbox" class="checkitem" value="<?php echo $v['id']?>" /><?php endif;?></td>
      <td><?php echo $v['name']?></td>
      <td><?php echo $v['description']?></td>
      <td style=" text-align: center;">
          <a href="javascript:;" onclick="islock(this,'<?php echo $v['id']?>')">
          <?php if($v['status'] == 1):?>
          <img src="<?php echo IMG_PATH?>right.png">
          <?php else:?>
          <img src="<?php echo IMG_PATH?>error.png">
          <?php endif;?>
          </a>
      </td>
      <td class="handler">
      <span style="width: 100px">
      <a href="<?php echo site_url(array('a'=>'edit','id'=>$v['id']))?>"><?php L('edit')?></a> <?php if($v['id'] != 1):?>| <a href="javascript:drop_confirm('{$lang.drop_confirm}', '{php echo site_url('admin/role/drop')}?id={$user.id}');"><?php L('drop')?></a><?php endif;?>
      </span>
      </td>
    </tr>
    <?php endforeach;?>
    <?php else:?>
    <tr class="no_data">
      <td colspan="10"><?php L('no_data')?></td>
    </tr>
    <?php endif;?>
  </table>
  <?php if($lists):?>
  <div id="dataFuncs">
    <div id="batchAction" class="left paddingT15"> &nbsp;&nbsp;
      <input class="formbtn batchButton" type="button" value="<?php L('drop')?>" name="uid" uri="{php echo site_url('admin/role/drop')}" presubmit="confirm('{$lang.drop_confirm}');" />
    </div>
    <div class="pageLinks">
        <?php self::tpl_display('page');?>
    </div>
    <div class="clear"></div>
  </div>
  <?php endif;?>
</div>
<?php self::tpl_display('footer');?>